import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/school/index'
import view from '@/components/school/view'
import evaluate from '@/components/school/evaluate'
import member from '@/components/school/member'
import needindex from '@/components/needs/index'
import userindex from '@/components/users/index'
import orderview from '@/components/order/view'
import feedback from '@/components/users/feedback'
import allerror from '@/components/error/allerror'
import signup from '@/components/school/signup'
import authlogin from '@/components/users/authlogin'
import paymentsucc from '@/components/order/paidsucc'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/view/:id/:gid',
      name: 'view',
      component: view
    },
    {
      path: '/signup/:id/:gid',
      name: 'signup',
      component: signup
    },
    {
      path: '/evaluate/:id',
      name: 'evaluate',
      component: evaluate
    },
    {
      path: '/member/:id/:title/:gid',
      name: 'member',
      component: member
    },
    {
      path: '/needs/index',
      name: 'needindex',
      component: needindex
    },
    {
      path: '/users/index',
      name: 'userindex',
      component: userindex
    },
    {
      path: '/order/view/:id',
      name: 'orderview',
      component: orderview
    },
    {
      path: '/users/feedback',
      name: 'feedback',
      component: feedback
    },
    {
      path: '/error/:msg',
      name: 'allerror',
      component: allerror
    },
    {
      // 接受登录数据
      path: '/users/authlogin/:username/:nickname/:head_img/:jwt/:jwt_refresh',
      name: 'authlogin',
      component: authlogin
    },
    {// 支付成功
      path: '/paidsucc/:price',
      name: 'paymentsucc',
      component: paymentsucc
    }
  ]
})
